from django.conf.urls import url

# from rest_framework.routers import DefaultRouter
from rest_framework.routers import DefaultRouter


from . import views

urlpatterns = [
    # url(r"^areas/$", views.AreasView.as_view()),
    # url(r"^areas/(?P<pk>\d+)/$", views.AreaView.as_view()),

]

# 请求方式: GET /areas/(?P<pk>\d+)/



# 给视图生成路由
# router = DefaultRouter()
router = DefaultRouter()


# router.register("路由前缀","视图集类","别名前缀")

router.register("areas", views.AreaViewSet, "area")
# router.register("areas",views.AreasViewSet,"area")


# urlpatterns += router.urls
urlpatterns += router.urls